<template>
  <TitleBar />
  <router-view />
</template>

<script setup>
  import TitleBar from './view/TitleBar/index.vue'
  import { useResizeStore } from '@/store'
  import { onMounted } from 'vue'
  import { useGameLoopStore } from '@/store/gameLoop'

  const store = useResizeStore()
  const loopStore = useGameLoopStore()

  const handleResize = (resize) => {
    // console.log('resize-app: ', resize)
    store.resize = resize
  }

  onMounted(() => {
    window.api.getResize(handleResize)
    loopStore.gameLoop()
  })
</script>